opt-in rustls-ffi FIPS support, Linux CI coverage#478
Conversation
Pulling this out into a separate PR since I have some TODOs for this one: #479 |
The Ubuntu FIPS CI works great, and so do my local test builds on Both MacOS and Windows build the Rust The MacOS builds fail to compile the client/server example Similar failures for the Probably missing some extra linker arguments for the C programs (?) - have to put a pin in this for today but will debug further when time permits. |
This comment was marked as outdated.
This comment was marked as outdated.
|
I believe the root cause of the trouble here is that I didn't realize the aws-lc FIPS module only supports static linking on Linux. On macOS the module .dylib needs to be used (aws/aws-lc-rs#495). On Windows, there are two Both are limitations we can surmount for the CI integration testing of a FIPS-enabled client/server test binary, but I need to think about the best way to pull out a predictable file path for both the Taking Windows as an example, right now they're under paths like: I'm not sure the right way to jig a @ctz Do you have any experience with this? |
Some progress in 6732976 - mostly struggling with The solution in that commit works without too much hardcoding, but it assumes you've run a More iteration (and probably an attempt to properly learn |
I'm afraid not :( |
Np! I will keep plugging away at this, more because I'm overdue to better understand the existing Windows build than because I think it's super important to get working. Worst case I'll land Linux in CI and we can circle back on MacOS/Windows testing of the FIPS builds later on. |
93c09f3 to
365823d
Compare
I backed out the CI bits for MacOS and Windows. You can still build I've learned a lot (some would say: too much) about
Alternatively we could table this PR, do the build bits, and then rebase it and land it with full CI coverage. |
|
@jsha Is this a branch I should hold for your review? 🙇 |
Using `make FIPS=true` with the Makefiles, or `cmake -DFIPS="true" -S . -B build` with the Windows cmake build will activate the `aws-lc-rs` feature of `rustls-ffi`, and the `rustls/fips` feature of Rustls. On Linux our test client/server binaries Just Work thanks to the magic of static linking. On MacOS/Windows life is more complicated. For now we'll land support without testing on these platforms since the dynamic linking setup required for the end-user application is tricky. See the rustls manual[0] and the aws-lc-rs-fips-sys crate[1] for more information and further FIPS related caveats. [0]: https://docs.rs/rustls/latest/rustls/manual/_06_fips/index.html [1]: https://crates.io/crates/aws-lc-fips-sys
* Ability to instantiate the FIPS default `crypto_provider` using a new function `rustls_default_fips_provider()`, available only when the fips feature is activated. * Ability to determine if a given `crypto_provider` is in FIPS mode using a new function `rustls_crypto_provider_fips()`. * Ability to determine if a given `rustls_client_config` would create connections that are FIPS compatible with a new function `rustls_client_config_fips()`. * Ability to determine if a given `rustls_server_config` would create connections that are FIPS compatible with a new function `rustls_server_config_fips()`. * Ability to determine if a given `rustls_connection` was created from a `rustls_client_config` or `rustls_server_config` that was FIPS enabled with a new function `rustls_connection_fips()`.
last time we chatted on this subject you mentioned being OK with merges that get a review from another team member if you don't get to them within a few weeks. I think this branch falls into that category so I'm going to merge it. Let me know if I should adjust my heuristics in the future! |
FIPS feature
Using
make FIPS=truewith the Makefiles, orcmake -DFIPS="true" -S . -B buildwith the Windows cmake build will activate theaws-lc-rsfeature ofrustls-ffi, and therustls/fipsfeature of Rustls.On Linux our test client/server binaries Just Work thanks to the magic of static linking. On MacOS/Windows life is more complicated. For now we'll land support without CI testing on these platforms since the dynamic linking setup required for the end-user application is tricky. I have tested manually with success.
See the rustls manual and the aws-lc-rs-fips-sys crate for more information and further FIPS related caveats.
API additions
Ability to instantiate the FIPS default
crypto_providerusing a new functionrustls_default_fips_provider(), available only when the fips feature is activated.Ability to determine if a given
crypto_provideris in FIPS mode using a new functionrustls_crypto_provider_fips().Ability to determine if a given
rustls_client_configwould create connections that are FIPS compatible with a new functionrustls_client_config_fips().Ability to determine if a given
rustls_server_configwould create connections that are FIPS compatible with a new functionrustls_server_config_fips().Ability to determine if a given
rustls_connectionwas created from arustls_client_configorrustls_server_configthat was FIPS enabled with a new functionrustls_connection_fips().Future work
cmaketidying before further investing in this direction.